/**
 * 
 */
package com.chris.design.pattern.samples.factory;

/**
 * @author shangpan
 * @since July 21, 2018
 */
public class CpuFactory {
	
	/**
	 * 创建cpu
	 * @param key
	 * @return
	 */
	public static Cpu cpuCreator(String key) {
		Cpu cpu = null;
		switch (key) {
			case "intel":
				cpu = new IntelCpu(755);
//				break;
			case "amd":
				cpu = new AmdCpu(938);
//				break;
			default:
//				cpu = new IntelCpu(733);
//				break;
			return cpu;
		}
	}
}
